package cool.taomu.toolkit.jesery

import cool.taomu.toolkit.TaomuConfigure
import cool.taomu.toolkit.TaomuGuice
import cool.taomu.toolkit.TaomuGuiceServiceLoader
import cool.taomu.toolkit.crypto.Base64
import java.util.concurrent.TimeUnit
import cool.taomu.toolkit.Context
import com.google.inject.Key
import com.google.inject.TypeLiteral
import com.google.inject.name.Names
import java.util.List

class DruidTest {
	
    def static main(String[] args) {
        val TaomuConfigure config = new TaomuConfigure(new Base64()).loadConfig
        var injector = TaomuGuice.createInjector(config)
        TaomuGuiceServiceLoader.loadIPlatform(injector, config)
        var context = injector.getInstance(Context);
        var list = context.injectorSupplier.get.getInstance(Key.get(new TypeLiteral<List<String>>() {
            }, Names.named(TaomuGuice.JESERY_PACKAGES)))
        println(list) 
        while (true) {
			try {
				TimeUnit.HOURS.sleep(1)
			} catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				System.err.println("Thread interrupted");
				return;
			}
		}
    }
}

